from appium import webdriver

desired_caps = {
    "platformName": "Android",
    "deviceName": "Custom Phone",
    "appPackage": "通讯录",
    "appActivity": "目标应用启动Activity",
    "noReset": True
}

driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", desired_caps)

# 定位目标元素并轻敲
target_element = driver.find_element_by_id("目标元素resourceId")
target_element.click()
print("轻敲操作成功")